<div class="card-block dt-responsive">

    <div class="table-responsive">
        <div id="dom-jqry_wrapper" class="dataTables_wrapper dt-bootstrap4">

            <table class="table table-striped table-bordered table-hover">

                <thead>
                <tr>
                    <g:sortableColumn property="name" title="名称"/>
                    <g:sortableColumn property="workflow" title="工作流"/>
                    <g:sortableColumn property="stage" title="当前阶段"/>
                    <g:sortableColumn property="status" title="当前状态"/>
                    <g:sortableColumn property="createdDate" title="创建时间"/>
                    <g:sortableColumn property="modifiedDate" title="修改时间"/>
                    <g:sortableColumn property="operation" class="text-center" colspan="4" title="操作"/>
                </tr>
                </thead>
                <tbody>
                <g:each in="${workflowInstanceList}">
                    <tr>
                        <td>
                            <sec:ifAllGranted roles="ROLE_ADMINISTRATOR">
                                <g:link controller="workflowInstance" action="show"
                                        id="${it?.id}">${it?.name}</g:link>
                            </sec:ifAllGranted>
                            <sec:ifNotGranted roles="ROLE_ADMINISTRATOR">
                                ${it?.name}
                            </sec:ifNotGranted>
                        </td>
                        <td>${it?.workflow?.name}</td>
                        <td>${it?.stage?.name}</td>
                        <td>${it?.status?.name}</td>
                        <td>${it?.createdDate}</td>
                        <td>${it?.modifiedDate}</td>
                        <td class="text-center">
                            <g:link class="btn btn-mini btn-outline-info" controller="workflowInstance" id="${it?.id}"
                                    action="reject"><i class="icofont icofont-swoosh-up"></i> 上一步</g:link>
                            <g:link class="btn btn-mini btn-outline-primary" controller="workflowInstance" id="${it?.id}"
                                    action="approve"><i class="icofont icofont-swoosh-down"></i> 下一步</g:link>
                            <g:link class="btn btn-mini btn-outline-danger" controller="workflowInstance" id="${it?.id}"
                                    action="cancel"><i class="icofont icofont-info-circle"></i> 失败</g:link>
                            <g:link class="btn btn-outline-success btn-mini" controller="workflowInstance" id="${it?.id}"
                                    action="complete"><i class="icofont icofont-ui-check"></i> 完成</g:link>
                        </td>

                    </tr>
                </g:each>
                </tbody>

            </table>
        </div>
    </div>

</div>

